package com.xyy.saas.payment.cores.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Map;

@Getter
@Setter
public class FuminRecordBo implements Serializable {
    private static final long serialVersionUID = -6907333172448344887L;
    /**
     * 记账账簿号
     */
    private String accountCoreNo;
    /**
     * 账户号/虚户号
     */
    private String accountNo;
    /**
     * 交易时间
     */
    private String tradeDate;
    /**
     * 富民流水号
     */
    private String tradeFlowNo;
    /**
     * 商户流水号
     */
    private String flowNo;
    /**
     * 交易金额
     */
    private String amount;
    /**
     * 交易后余额
     */
    private String balance;
    /**
     * 资金流向
     */
    private String direction;
    /**
     * 处理状态
     */
    private String handStatus;
    /**
     * 交易类型
     */
    private String tradeType;
    /**
     * 入帐方账户
     */
    private String accountIn;
    /**
     * 入账方账户名
     */
    private String accountInName;
    /**
     * 出账方账户
     */
    private String accountOut;
    /**
     * 出账方账户名
     */
    private String accountOutName;
    /**
     * 出账方银行行号
     */
    private String accountOutBankCode;
    /**
     * 出账方银行名称
     */
    private String accountOutBankName;
    /**
     * 备注
     */
    private String memo;

    /**
     * 构建对象
     */
    public static FuminRecordBo build(Map<String, String> item) {
        FuminRecordBo recordBo = new FuminRecordBo();
        recordBo.setAccountCoreNo(item.get("accountCoreNo"));
        recordBo.setAccountNo(item.get("accountNo"));
        recordBo.setAmount(item.get("amount"));
        recordBo.setBalance(item.get("postBalance"));
        recordBo.setDirection(item.get("direction"));
        recordBo.setHandStatus(item.get("status"));
        recordBo.setMemo(item.get("remark"));
        recordBo.setAccountOut(item.get("othBaseAcctNo"));
        recordBo.setAccountOutName(item.get("othAcctDesc"));
        recordBo.setAccountOutBankCode(item.get("othBankCode"));
        recordBo.setAccountOutBankName(item.get("othBankName"));
        recordBo.setFlowNo(item.get("merchantOrderNo"));
        recordBo.setTradeDate(item.get("finishTime"));
        recordBo.setTradeFlowNo(item.get("bizNo"));
        recordBo.setTradeType(item.get("tradeType"));
        return recordBo;
    }
}
